﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
using T.FAS.Runtime.Expression.Entity;
using T.ServiceComponent.DAC.Service;
using T.ServiceComponent.Database.Service;

namespace T.FAS.Runtime.Expression.Dev.Dao
{
    public class ExprDesignConfigDao : DaoService<ExprDesignConfig>
    {
        public ExprDesignConfigDao() :
           base()
        {
            DBName = "TFAS";
        }

        public override string TableName => "FAS_ExprDesignConfig";
        public override string IDColumnName => "ID";
        public List<ExprDesignConfig> GetExprDesignConfigs(string configType)
        {
            var result = new List<ExprDesignConfig>();
            List<object> objects = base.GetObjectsByFilter(string.Format("ConfigType='{0}'", configType));
            if (objects != null)
            {
                objects.ForEach(obj => result.Add(obj as ExprDesignConfig));
            }
            return result.OrderBy(t => t.SortOrder).ToList();
        }
    }
}
